package com.HomeWorkhsp.chapter10.homework.homework07;
import java.util.Scanner;
/**
 * Enjoy programming!!!
 * Time: 2021/12/12 -  20:09
 */
public class Car {
    private int temperature;

    class Air {
        public void flow() {
            if(temperature >= 40) {
                System.out.printf("现在温度是%d开始冷吹风\n",temperature);
            }
            else if(temperature < 0) {
                System.out.printf("现在温度是%d,吹热风\n",temperature);
            }
            else{
                System.out.printf("现在温度是%d,关闭空调\n",temperature);
            }
        }
    }
    public void setTemperature(int n){
        temperature = n;
    }

}
class Test{
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        System.out.print("请输入当前温度");
        int n = in.nextInt();

        Car car  = new Car();
        car.setTemperature(n);
        Car.Air air = car.new Air();
        air.flow();
    }
}
